#include "shopinfo.h"
#include "utils.h"

ShopInfo::ShopInfo(QObject *parent)
    : QObject{parent}
{}


ShopInfo* ShopInfo::FromJson(QJsonObject data) {
    auto info = new ShopInfo();
    info->TenantSign = GetString(data, "tenantSign");
    info->ShopName = GetString(data, "shopName");
    info->ShopCode = GetString(data, "shopCode");
    info->PrinterDpi = GetString(data, "printerDpi").toInt();
    info->PrinterName = GetString(data, "printerName");
    info->HShift = GetString(data, "hShift").toInt();
    info->VShift = GetString(data, "vShift").toInt();
    info->PrinterIp = GetString(data, "printerIp");
    info->PrinterPort = GetString(data, "printerPort");
    info->PrinterXML = GetString(data, "printerXML");
    info->PrinterTemplateVersion = GetString(data, "printerTemplateVersion");

    return info;
}
